/**
 * Copyright (c) 2003-2017 Ben Lau
 * All rights reserved.
 */
package jvmtuning;

import java.util.Vector;

/**
 * -XX:+PrintGCDetails -Xms10M -Xmx40M -XX:MinHeapFreeRatio=40 -XX:MaxHeapFreeRatio=50
 * 
 * -XX:+PrintGCDetails -Xms40M -Xmx40M -XX:MinHeapFreeRatio=40 -XX:MaxHeapFreeRatio=50
 * 
 * @author liubin
 *
 */
public class HeapSize {

	/**
	 * @param args
	 * @throws InterruptedException 
	 */
	public static void main(String[] args) throws InterruptedException {
		Vector vector = new Vector<>();
		while(true) {
			byte[] bs = new byte[1024*1024];
			vector.add(bs);
			if (vector.size() == 10) {
				vector = new Vector();
				Thread.sleep(1);
			}
		}
	}

}
